#include "Input.h"


Input* Input::input = 0;


Input* Input::getInstance()
{
	if (!input)
	{
		input = new Input();
	}
	return input;
}


void Input::destroyInstance()
{
	delete input;
	input = 0;
}


bool Input::keyPressed(char key) const
{
	return keysPressed[key];
}


bool Input::specialKeyPressed(char key) const
{
	return specialKeysPressed[key];
}


void Input::handleKeyPress(char key)
{
	keysPressed[key] = true;
}


void Input::handleSpecialKeyPress(char key)
{
	specialKeysPressed[key] = true;
}


void Input::reset()
{
	for (int i = 0 ; i < 255; ++i)
	{
		keysPressed[i] = false;
		specialKeysPressed[i] = false;
	}
}


Input::Input()
{
	reset();
}
